package com.bosssoft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bosssoft.entity.po.FibDepartmentPO;
import com.bosssoft.entity.po.FibFiscalPO;
import java.util.List;

import org.apache.ibatis.annotations.*;

/**
 * @author Li kexi
 * Created on 2021/8/16.14:30
 */
@Mapper
public interface FibFiscalMapper extends BaseMapper<FibFiscalPO> {

    @Select("select deleted " +
            "from fib_fiscal where fis_id = #{id}")
    int selectDeleted(Long id);

    @Select("select fis_id,fis_name,fis_code,fis_address,fis_phone,create_time,update_time,create_by,update_by,deleted,version " +
            "from fib_fiscal limit #{offset},#{limit}")
    List<FibFiscalPO> selectAll(Long offset, Long limit);
    @Delete("delete from fib_fiscal where fis_id = #{fisId}")
    boolean delete(FibFiscalPO fibFiscalPO);
    /**
     * 修改数据
     *
     * @return 影响行数
     */
    @Update("update fib_fiscal set \n" +
            "fis_id = #{fisId},fis_name = #{fisName},fis_code = #{fisCode},fis_address = #{fisAddress},fis_phone = #{fisPhone}," +
            "deleted = #{deleted},update_time = now(),update_by = #{updateBy},version = version + 1 \n" +
            "where fis_id = #{fisId}")
    boolean update(FibFiscalPO fibFiscalPO);
    @Update("update fib_fiscal set \n" +
            "deleted = #{deleted},update_time = now(),update_by = #{updateBy},version = version + 1 \n" +
            "where fis_id = #{fisId}")
    boolean updateDeleted(FibFiscalPO fibFiscalPO);

}